home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / amigae / debug_m.lha / debug.doc < prev    next >
Encoding:
Text File  |  1994-10-10  |  2.7 KB  |  74 lines

  1. REQUIREMENTS :
  2. ~~~~~~~~~~~~~~
  3.     Amiga E v3.0 and kickstart 1.3 or better.
  4.  
  5.  
  6. INTRODUCTION :
  7. ~~~~~~~~~~~~~~
  8.     debug.m is the E module equivalent to the C linked library debug.lib.
  9. If you already know this linked library, you can skip this introduction
  10. and directly go to the TECHNICAL section.
  11.     For those who don't know this link library, let me give you a little
  12. explanation of its interest. Indeed, it contains simple input/output
  13. functions for the serial port. Thanks to them, you can use a remote debug-
  14. ging terminal linked to your Amiga via the serial port. But nobody have
  15. a debugging terminal linked to his Amiga :-) So a solution is to used
  16. Sushi which is developper tool (but also available on aminet) to intercept
  17. raw serial debugging output and to redirect it to a simple CON window.
  18. So every Amiga can take benefit from these function. But what is the
  19. interest for a sample Amiga E user in relation to the WriteF() procedure ?
  20. I see two advantages :
  21.     - debugging output isn't mixed with normal output
  22.     - you can't use functions like WriteF(), PrintF(), etc (in fact, all
  23. the dos.library function) outside a process context, in other words, you
  24. MUST use debug.m functions instead for exec tasks, devices, handlers, etc
  25.  
  26.  
  27. EXAMPLE USING :
  28. ~~~~~~~~~~~~~~~
  29. MODULE 'Tools/debug' -> of course you have put debug.m in EMODULES:Tools
  30.  
  31. PROC main()
  32.  
  33.     DEF var , str[ 100 ] : STRING
  34.  
  35.     -> a lot of critical calculations around var and str
  36.  
  37.     kputfmt( 'var = \d & str = \s\n' , [ var , str ] )
  38.         -> breath deeply : you know now what var and str are :-)
  39.         -> note that you called kputfmt() exactly as you would have done
  40.         ->  for vprintf(), simple isn't it ?
  41.  
  42.     -> let's continue again critical things !
  43.  
  44. ENDPROC
  45.  
  46.  
  47. TECHNICAL :
  48. ~~~~~~~~~~~
  49.     The procedures of debug.m are :
  50.     - kcmpstr( str1 : PTR TO CHAR , str2 : PTR TO CHAR )
  51.     - char := kgetchar()
  52.     - number := kgetnum()
  53.     - char := kmaygetchar()
  54.     - kputfmt( format_string : PTR TO CHAR , data_stream : PTR TO LONG )
  55.     - kputchar( char )
  56.     - kputstr( str : PTR TO CHAR )
  57.     For further details, buy and read The Amiga Guru Book, an excellent
  58. book.
  59.  
  60.     To do debug.m, I disassembled debug.lib, modified a bit the resulting
  61. source (in fact I removed useless things for E users and adapted parameters
  62. passing to E rules), reassembled it and finally used o2m.
  63.  
  64. DISTRIBUTION & DISCLAIMER :
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66.     This archive is completely public domain : DO WHAT YOU WANT WITH IT !
  67.  
  68.     However, I cannot be held responsible for the use of these files and
  69. any damages that they may cause directly or not. I want this to be clear :
  70. YOU USE THEM AT YOUR OWN RISK !
  71.  
  72.  
  73.     Lionel Vintenat (vintenat@reseau.onecert.fr)
  74.